package com.msdemo.goods.service.client.fallback;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.msdemo.goods.service.client.OrderServiceClient;

import feign.hystrix.FallbackFactory;

/**
* @comments
* @author  zg
* @date 2018年9月9日
*/
//@Component
public class OrderServiceFallbackFactory implements FallbackFactory<OrderServiceClient>{
	private Logger logger = LogManager.getLogger(this.getClass());
	
	@Override
	public OrderServiceClient create(Throwable cause) {
		
		return new OrderServiceClient() {
			
			@Override
			public String createOrder(String userName, String goodsId) {
				logger.info("回退异常日志：", cause);
				return null;
			}
		};
		
	}
	
	

}
